#include <iostream>
#include <string>
using namespace std;

struct hero
{
    /* data */
    string name;
    int age;
    string sex;
};
void sort(hero h[], int len)
{
    for (int i = 0; i < 5; i++)
    {
        /* code */
        for (int j = 0; j < 5 - i - 1; j++)
        {
            /* code */
            if (h[j + 1].age < h[j].age)
            {
                /* code */
                hero t = h[j];
                h[j] = h[j + 1];
                h[j + 1] = t;
            }
        }
    }
}
int main()
{
    hero h[5] = {
        {"刘备", 23, "男"},
        {"关羽", 22, "男"},
        {"张飞", 20, "男"},
        {"赵云", 21, "男"},
        {"黄忠", 19, "男"},
    };
    sort(h, sizeof(h) / sizeof(h[0]));
    for (int i = 0; i < 5; i++)
    {
        /* code */
        cout << h[i].name << "\t" << h[i].age << "\t" << h[i].sex << endl;
    }

    return 0;
}